package com.kmsoft.gateway.config;

import com.kmsoft.gateway.application.GatewayConfigApplicationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Slf4j
@Component
public class InitStartUp implements ApplicationRunner {

    @Resource
    private GatewayConfigApplicationService gatewayConfigApplicationService;

    @Override
    public void run(ApplicationArguments applicationArguments) {
        log.info("==============init route config");
        gatewayConfigApplicationService.refreshRoute();
    }
}
